/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.caresms.model.impl;

import com.caresms.model.Country_Master;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import java.io.Serializable;

import java.util.Date;

/**
 * The cache model class for representing Country_Master in entity cache.
 *
 * @author cc
 * @see Country_Master
 * @generated
 */
public class Country_MasterCacheModel implements CacheModel<Country_Master>,
	Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(15);

		sb.append("{CountryId=");
		sb.append(CountryId);
		sb.append(", CountryName=");
		sb.append(CountryName);
		sb.append(", field1=");
		sb.append(field1);
		sb.append(", field2=");
		sb.append(field2);
		sb.append(", field3=");
		sb.append(field3);
		sb.append(", field4=");
		sb.append(field4);
		sb.append(", field5=");
		sb.append(field5);
		sb.append("}");

		return sb.toString();
	}

	public Country_Master toEntityModel() {
		Country_MasterImpl country_MasterImpl = new Country_MasterImpl();

		country_MasterImpl.setCountryId(CountryId);

		if (CountryName == null) {
			country_MasterImpl.setCountryName(StringPool.BLANK);
		}
		else {
			country_MasterImpl.setCountryName(CountryName);
		}

		if (field1 == null) {
			country_MasterImpl.setField1(StringPool.BLANK);
		}
		else {
			country_MasterImpl.setField1(field1);
		}

		country_MasterImpl.setField2(field2);
		country_MasterImpl.setField3(field3);

		if (field4 == Long.MIN_VALUE) {
			country_MasterImpl.setField4(null);
		}
		else {
			country_MasterImpl.setField4(new Date(field4));
		}

		if (field5 == null) {
			country_MasterImpl.setField5(StringPool.BLANK);
		}
		else {
			country_MasterImpl.setField5(field5);
		}

		country_MasterImpl.resetOriginalValues();

		return country_MasterImpl;
	}

	public long CountryId;
	public String CountryName;
	public String field1;
	public boolean field2;
	public int field3;
	public long field4;
	public String field5;
}